<template>
  <div class="tabs">
    <el-tag
      :key="tag.name"
      v-for="(tag, index) in this.$store.state.Tags"
      closable
      :disable-transitions="false"
      @close="handleClose(index)"
      :class="{ tagactive: tag.active == true }"
      @click="handleClick(tag)">
      {{tag.name}}
    </el-tag>
  </div>
</template>
<script>
  export default {
    name: "tabs",
    data() {
      return {
      }
    },
    methods: {
      handleClose(index) {
        this.$store.commit("delTab", index);
      },
      handleClick(item) {
        this.$router.push({ path: item.path })
        console.log(item)
      }
    }
  }
</script>
<style>
  .tabs .tagactive {
    background: rgba(46, 153, 255, 0.16) !important;
  }
</style>
